<#assign basePath = request.contextPath >
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="keywords" content="jquery,ui,easy,easyui,web">
	<meta name="description" content="easyui help you build your web page easily!">
	<title>RSS Reader Demo - jQuery EasyUI</title>
	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/icon.css">
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript">
	
	
	$(function(){
		$("#tree").tree({
			url: '${basePath}/nav/list.json',
			method: 'get',
			lines:true,
			loadFilter: function(data){
				if (data.data){
            		return data.data;
		        } else {
		            return data;
		        }
		    },
			onClick:function(node){
				if(node.attributes){
					openTab(node.text,node.attributes.url);
				}
			}
		});
		
		function openTab(text,url){
			if($("#tabs").tabs('exists',text)){
				$("#tabs").tabs('select',text);
			}else{
				var content="<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src=" +"${basePath}"+url+ "></iframe>";
				$("#tabs").tabs('add',{
					title:text,
					closable:true,
					content:content
				});
			}
		}
	});
</script>
	
</head>
<body class="easyui-layout">
	<div region="north" style="height: 80px;background-color:#E0ECFF">
		<div style="float:left"><a href='http://www.java1234.com' target=_blank><img src="images/logo.gif"/></a></div>
		<div style="float:right;padding:10px;"></div>
	</div>
	<div region="center">
		<div class="easyui-tabs" fit="true" border="false" id="tabs">
			<div title="首页" >
			</div>
		</div>
	</div>
	<div region="west" style="width: 200px;padding:15px;" title="导航菜单" split="true">
		<ul id="tree"></ul>
	</div>
</body>
</html>